﻿@*
@{ string appmsgUiTheme = "~/Content/themes/" + @ViewBag.UiTheme + "/ApplicationMessages.css"; }
<link href="@Url.Content(@appmsgUiTheme)" rel="stylesheet" type="text/css"/>
<script src="@Url.Content("~/Scripts/ApplicationMessages2.js")" type="text/javascript"></script>
*@

<div id="@("applicationMessagesHeader_" + @Model)"></div>

<script type="text/javascript">
    $(function () {
        $.getJSON('/Shared/ApplicationMessagesData', { 'showToUser': '1' }, function (json) {
            var j = $.parseJSON(json);
            $.each(j.results, function (i, message) {
                $("#applicationMessagesHeader_@(Model)").applicationMessage('add', {
                    'id': message.id,
                    'level': message.level,
                    'message': message.message,
                    'description': message.description,
                    'header': message.level + ' message on ' + message.messageDate + ' at ' + message.messageTime + ': ',
                    'seconds': message.seconds,
                    'parentElement': 'applicationMessagesHeader_@(Model)_'
                });
            });
        });
//        $.getJSON('/Shared/ValidationMessagesData', { }, function (json) {
//            var j = $.parseJSON(json);
//            $.each(j.results, function (i, message) {
//                $("#applicationMessagesHeader_@(Model)").applicationMessage('add', {
//                    'id': message.id,
//                    'level': message.level,
//                    'message': message.message,
//                    'description': message.description,
//                    'header': message.level + ' message on ' + message.messageDate + ' at ' + message.messageTime + ': ',
//                    'seconds': message.seconds,
//                    'parentElement': 'applicationMessagesHeader_@(Model)_'
//                });
//            });
//        });
    });
</script>

